{% load i18n %}
{% load humanize %}

<li feed-id="{{ feed.pk }}" csrf="{{ csrf_token }}">
    <a href="{% url 'profile' feed.user.username %}"><img src="{{ feed.user.profile.get_picture }}" class="user"></a>

    <div class="post">

        {% if feed.user == user or user.is_superuser %}
            <span class="glyphicon glyphicon-remove remove-feed" title="{% trans 'Click to remove this feed' %}"></span>
        {% endif %}

        <h3><a href="{% url 'profile' feed.user.username %}">{{ feed.user.profile.get_screen_name }}</a>
            <small>{{ feed.date|naturaltime }}</small>
        </h3>
        <p>{{ feed.linkfy_post|safe }}</p>

        {% if not user.is_anonymous %}
            <div class="interaction">
                {% if user in feed.get_likers %}
                    <a href="#" class="like unlike">
                        <span class="glyphicon glyphicon-thumbs-up"></span>
                        <span class="text">{% trans 'Unlike' %}</span>
                        (<span class="like-count">{{ feed.likes }}</span>)
                    </a>
                {% else %}
                    <a href="#" class="like">
                        <span class="glyphicon glyphicon-thumbs-up"></span>
                        <span class="text">{% trans 'Like' %}</span>
                        (<span class="like-count">{{ feed.likes }}</span>)
                    </a>
                {% endif %}
                <a href="#" class="comment">
                    <span class="glyphicon glyphicon-comment"></span> {% trans 'Comment' %}
                    (<span class="comment-count">{{ feed.comments }}</span>)
                </a>
            </div>
            <div class="comments">
                <form role="form" method="post" action="{{ comment }}" onsubmit="return false">
                    {% csrf_token %}
                    <input type="hidden" name="feed" value="{{ feed.pk }}">
                    <input type="text" class="form-control input-sm" placeholder="{% trans 'Write a comment...' %}"
                           name="post" maxlength="255">
                </form>
                <ol class="clearfix">
                    {% comment %} Place holder to load feed comments {% endcomment %}
                </ol>
            </div>
        {% endif %}

    </div>
</li>
